<template>
	<view>
		<view class="searchBar">
			<u-search shape="square" placeholder="请输入要查询的学生的姓名" @search="search(value)"></u-search>
		</view>
		<view class="userTable">
			<uni-table border stripe emptyText="暂无更多数据">
				<uni-tr>
					<uni-th align="center" width="20">学生姓名</uni-th>
					<uni-th align="center" width="130">完成的测试</uni-th>
				</uni-tr>
				<uni-tr v-for="(item,index) in userTable" :key="index">
					<uni-td align="center">{{item.username}}</uni-td>
					<uni-td align="center"><span @click="showDetail(item)">{{item.finishExam}}</span></uni-td>
				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
	import {
		uniTable,
		uniTr,
		uniTh,
		uniTd
	} from '@dcloudio/uni-ui'
	export default {
		data() {
			return {
				userTable:[
					{username:'zbl',finishExam:'phq'},
					{username:'zbl',finishExam:'ph'}
				]
			}
		},
		methods: {
			showDetail(item){
				console.log(item)
				uni.navigateTo({
					url:`/pages/Record/RecordDetail/RecordDetail`
				})
			},
			search(value){
				console.log(value)
			}
		},
		components: {
			uniTable,
			uniTr,
			uniTh,
			uniTd
		},
	}
</script>

<style>
.searchBar{
	margin-bottom: 20px;
}
</style>
